﻿namespace MyFloridaHouse.SilverlightOpenDistricts
{

    public partial class MainPage
    {
        // this is a VIEW trigger that listens for an event in the VIEW-MODEL

        Microsoft.Maps.MapControl.Core.MapMode previousMode = null;
        Microsoft.Maps.MapControl.Core.MapMode mercatorMode = new Microsoft.Maps.MapControl.Core.MercatorMode();
        public void onToggleBingVisibility()
        {
            Microsoft.Maps.MapControl.Core.MapMode currentMode = MyXamlMainMap.Mode;

            if (viewModelBase.isBingVisible)
            {
                // turn on bing Map
                MyXamlMainMap.Mode = previousMode;
            }
            else
            {
                // turn off bing maps
                MyXamlMainMap.Mode = new Microsoft.Maps.MapControl.Core.MercatorMode();

                
            }

            previousMode = currentMode;
        }

        // End VIEW trigger
    }
}
